/**
 * 版权声明：厦门睿商网络科技有限公司 版权所有 违者必究
 * 日    期：2020-12-15
 */
package com.rzico.article.service;

import com.rzico.article.entity.BillChefAffiliated;
import com.rzico.article.mapper.BillChefAffiliatedMapper;
import com.rzico.article.model.ShopBillFare;
import com.rzico.base.BaseMapper;
import com.rzico.base.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <pre>
 * 名厨关联店铺业务类
 * </pre>
 *
 * @author Rzico Boot
 * @version 1.0
 */
@Service
public class BillChefAffiliatedService extends BaseServiceImpl<BillChefAffiliated, String> {

    @Autowired
    private BillChefAffiliatedMapper billChefAffiliatedMapper;

    @Override
    public BaseMapper<BillChefAffiliated, String> getMapper() {
        return billChefAffiliatedMapper;
    }

    public List<ShopBillFare> selectBillChefList(Long chefId,String shopName,Integer type) {
        Map<String,Object> params = new HashMap<>();
        params.put("chefId",chefId);
        params.put("shopName",shopName);
        params.put("type",type);
        return billChefAffiliatedMapper.selectBillChefList(params);

    }

    public ShopBillFare selectBillChef(Long chefId,Long typeId) {
        Map<String,Object> params = new HashMap<>();
        params.put("chefId",chefId);
        params.put("typeId",typeId);
        List<ShopBillFare> shopBillFareList = billChefAffiliatedMapper.selectBillChefList(params);
        if (shopBillFareList.size()>0) {
            return shopBillFareList.get(0);
        } else {
            return null;
        }

    }
    public List<BillChefAffiliated> selectFindList(Map<String, Object> params){
        return billChefAffiliatedMapper.selectFindList(params);
    }

    public int selectType(Map<String, Object> params){
        return billChefAffiliatedMapper.selectType(params);
    }
}
